import java.util.Random;


public class Dice
{
	int num;
	int sides;
	int bonus;
	
	public Dice(int num, int sides,int bonus)
	{
		this.num = num;
		this.sides = sides;
		this.bonus = bonus;
	}
	public int roll()
	{
		int total = 0;
		Random dice = new Random();
        total = total + dice.nextInt(sides) +1;
        total = total + bonus;
        return total;
	}
	
	public String toString()
	{
		return this.num + "d" + this.sides + "+" + this.bonus;
	}
	
}
